package com.yanqu.road.server.cmd.activity.holiday;

import com.yanqu.road.entity.activity.ActivityDisperseGoldInfo;
import com.yanqu.road.logic.pb.ActivityDisperseGoldPb;
import com.yanqu.road.pb.activity.ActivityDisperseGoldProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.manger.player.ActivityDisperseGoldMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = Protocol.S_ACTIVITY_DISPERSE_GOLD_MAIL_NOTICE, desc = "活动送财邮件通知")
public class SendMailNoticeCmd implements Command {


    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {

        ActivityDisperseGoldProto.ActivityDisperseGoldInfoTemp crossGoldInfoTemp = ActivityDisperseGoldProto.ActivityDisperseGoldInfoTemp.parseFrom(packet.getBytes());
        ActivityDisperseGoldInfo crossGoldInfo = ActivityDisperseGoldPb.parseToDisperseGoldInfo(crossGoldInfoTemp);
        ActivityDisperseGoldMgr.sendMailToGoldOwner(crossGoldInfo);

    }

}
